package com.seasky;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by RLY on 2018/12/18.
 */
public class SimpleSlf4jWithLog4j {
    private final static Logger logger = LoggerFactory.getLogger(SimpleLog4jMain.class);

    public static String greet(String name) {
        return "Hello, " + name;
    }


    public static double divide(int a, int b) {
        return 1.0 * a / b;
    }


    public static void main(String[] args) {
        logger.info("result:{}", greet("Jack"));
        User u = new User("Michael", 12);
        logger.info("result:{}", u);
        logger.warn("result:{}", divide(2, 3));

    }
}

class User {
    String name;
    int age;

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
